import { defineApis } from '@/utils/api'
//查询部门
const queryDepartments = {
  url: "/department",
  method: "get",
};

//获取部门树
const getDepartmentTree = {
  url: "/department/tree",
  method: "get",
};

//添加部门
const addDepartment = {
  url: "/department",
  method: "post",
};

//修改部门
const updateDepartment = {
  url: "/department",
  method: "put",
};

//删除部门
function removeDepartment(id: number) {
  return {
    url: `/department/${id}`,
    method: 'DELETE',
  }
}

export default defineApis('admin', {
  queryDepartments,
  getDepartmentTree,
  addDepartment,
  updateDepartment,
  removeDepartment
})